package com.syyo.gulimall.product.config.redis;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ author: wang
 * @ date: 2021/3/29 15:55
 * @ Description: 创建redissoon对象
 */
@Configuration
public class MyRedissonConfig {

    @Bean(destroyMethod = "shutdown")
    RedissonClient redisson() {

        Config config = new Config();
        config.useSingleServer().setAddress("redis://gulimall.com:6379").setPassword("123456");
        return Redisson.create(config);
    }

}
